import request from '@/utils/request'


// 查询钱包信息
export function queryStoreWallet(query) {
  return request({
    url: '/seller/sellerStoreWallet/findBySellerId',
    method: 'get',
    params: query
  })
}

// 查询流水明细
export function queryStoreWalletLog(query) {
  return request({
    url: '/wallet/seller/sellerStoreWalletLog/list',
    method: 'get',
    params: query
  })
}

// 查询测试单表列表
export function listDemo(query) {
  return request({
    url: '/demo/demo/list',
    method: 'get',
    params: query
  })
}

// 查询增值服务列表
export function serviceList(query) {
  return request({
    url: '/system/sysServiceMarket/showServiceList',
    method: 'get',
    params: query
  })
}

// 查询erp服务列表
export function serviceErpList(query) {
  return request({
    url: '/system/sysServiceMarket/showErpAmountList',
    method: 'get',
    params: query
  })
}

// 查询增值服务详情
export function serviceDetail(id) {
  return request({
    url: '/system/sysServiceMarket/' + id,
    method: 'get'
  })
}

// 获取分佣奖金配置比例
export function selectProp() {
  return request({
    url: '/purchase/distributeProp/selectProp',
    method: 'get'
  })
}

//修改分佣奖金配置比例
export function updateProp(query) {
  return request({
    url: '/purchase/distributeProp/updateProp',
    method: 'post',
    data: query
  })
}

// 购买ERP账号
export function createErpAmount(query) {
  return request({
    url: '/system/sysServiceMarket/createErpAmountServiceOrder',
    method: 'post',
    params: query
  })
}

// 购买增值服务
export function createService(query) {
  return request({
    url: '/system/sysServiceMarket/createServiceOrder',
    method: 'get',
    params: query
  })
}

// 判断是否展示开户按钮
export function modeStatus() {
  return request({
    url: '/system/sysServiceMarket/openModeStatus',
    method: 'get'
  })
}

// 获取当前用户有效期
export function userExpirationTime(id) {
  return request({
    url: '/distribution/user/getUserExpirationTime?userId=' + id,
    method: 'get'
  })
}

// 判断是否可以重复购买
export function checkErpAmount(userId, serviceId) {
  return request({
    url: '/system/sysServiceMarket/checkErpAmountBuyType?userId=' + userId + '&serviceId=' + serviceId,
    method: 'get'
  })
}

// 购买记录
export function buyRecord(query) {
  return request({
    url: '/system/sellerStoreServiceMarket/list',
    method: 'get',
    params: query
  })
}

// 服务市场erp用户开户
export function saveErpUser(query) {
  return request({
    url: '/system/sysServiceMarket/saveErpUser',
    method: 'post',
    data: query
  })
}

// 查询店铺的品牌页面展示
export function storeBrand(storeId) {
  return request({
    url: '/system/sellerStoreServiceMarket/getStoreBrandPage?storeId=' + storeId,
    method: 'get'
  })
}

// 选择品牌绑定
export function chooseStoreBrand(query) {
  return request({
    url: '/system/sellerStoreServiceMarket/chooseStoreBrand',
    method: 'post',
    params: query
  })
}

// 支付
export function pay(query) {
  return request({
    url: '/system/sysServiceMarket/pay',
    method: 'post',
    params: query
  })
}

// 获取先用后付列表
export function queryPayLaterList(query) {
  return request({
    url: '/serviceMarket/youthApplyInfo/list',
    method: 'get',
    params: query
  })
}

// 获取先用后付列表
export function confirmPayLaterList(query) {
  return request({
    url: '/serviceMarket/youthApplyInfo/confirm',
    method: 'get',
    params: query
  })
}
